<template>
  <div>
    <div class="top">
      <div class="top-price">
        ¥<span class="price">{{data.price}}</span>
      </div>
      <div class="top-right">
        <a href="#" @click.prevent="decrementPriceClick" class="decrement-price">
          降价提醒
        </a>
        <a href="#" @click.prevent="collectionClick" class="collection">
          收藏
        </a>
      </div>
    </div>
    <div class="center">
      <span>{{data.title}}</span>
    </div>
    <div class="down">
      {{data.descreption}}
    </div>
  </div>
</template>

<script>
  export default {
    name: "HomeDetailTitle",
    props:{
      data:{
        type:Object,
        default() {
          return {};
        }
      }
    },
    methods:{

      collectionClick(){

        console.log('降价了');

      },
      decrementPriceClick(){

      }

    }
  }
</script>

<style scoped>

  .top{
    display: flex;
    justify-content: space-between;
    height: 49px;
    /*line-height: 49px;*/
    padding: 10px 10px 0px;
  }

  .top .top-price{

    color: red;
    font-size: 20px;
  }

  .top-price .price{

    font-weight: bold;
    font-size: 30px;
  }

  .top-right{

    font-size: 10px;
    color: #999;
    text-align: center;
  }

  .decrement-price,.collection{

    display: inline-block;
    position: relative;
    width: 50px;
    height: 10px;
    padding-top: 20px;
  }

  .top-right .collection:after{

    content: "";
    position: absolute;
    top:0px;
    left: 12px;
    width: 20px;
    height: 20px;
    background-image: url("../../../../assets/img/common/star.png");
    background-position: 0px -40px;
    background-size: 25px 60px;
  }

  .decrement-price:after{
    content: "";
    position: absolute;
    top:0px;
    left: 12px;
    width: 20px;
    height: 20px;
    background-image: url("../../../../assets/img/common/star.png");
    background-position: 0px -5px;
    background-size: 25px 60px;
  }


  .center{
    font-weight: 700;
    color: #333;
    padding: 5px 10px;
  }

  .down{

    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.3em;
    color: #999;
  }



</style>
